package com.ihr360.cnb.module.common.service;

import cn.irenshi.organization.meta.entity.organization.CompanyStructureEntity;
import com.ihr360.cnb.module.common.service.fallback.OrganizationServiceFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Stone.Shi
 * @description
 * @date 2018-02-07 10:06:30.
 */
@FeignClient(name = "irenshi-organization-provider", fallback = OrganizationServiceFallback.class)
public interface OrganizationService {

    @RequestMapping(value = "/company/getCompanyStructure", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    List<CompanyStructureEntity> getCompanyStructure(@RequestParam(value = "companyId") String companyId);

    @RequestMapping(value = "/company/getDepartmentFullNames", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    Map<Long, String> getDepartmentFullNames(@RequestParam(value = "companyId") String companyId);
}
